 <?php 
 require_once "../include/global.php";
 $conn = dbconn();
 
 $grids=mysql_query("select id from groups");
while($row=mysql_fetch_assoc($grids))
{
	$gi=$row[id];
	$table=mysql_query("select * from pr_gr join groups where pr_gr.gr_id=groups.id and groups.id=$gi");
	$num_projs=mysql_num_rows($table);
	mysql_query("update `groups` set num_projs='$num_projs' where id=$gi;");
	// echo$num_projs.'<br>';
}

 mysql_close($conn); ?>